<template>
    <div class="index-main">
        <indexNavs />
        <searchBox />
    </div>
</template>

<script>
    import indexNavs from "./indexNavs"
    import searchBox from './searchBox'
    import { mapActions } from 'vuex'
    import { getHomeInfo } from "../../api/home";


    export default {
        components:{
            indexNavs,
            searchBox
        },
        data(){
            return{
                homeInfo:{},
                loading:true
            }
        },
        computed:{
            getStatus(){
                return this.$store.state.app.status
            }
        },
        mounted() {
            //this.query()
        },
        methods:{
            ...mapActions(['setStatus']),
            async query(){
                try {
                    const res=await getHomeInfo()
                    this.homeInfo=res.data
                    setTimeout(()=>{
                        this.loading=false
                    },2000)
                }
                catch (e) {
                    alert(e)
                }
            }
        }
    }
</script>

<style lang="less" scoped>
    .index-main{
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-size: cover;
        background-image: url("img/bg.jpg");
        background-repeat: no-repeat;
    }
</style>
